import axios from 'axios';
import store from '../store';

function getTime(){
    var time = new Date();
    time = time.toISOString();
    time = time.substring(0,10);
    return time;
}
export function saveEditor(){
    var params = {
        folder: $('#folder-list').find('.active').find('.folder-child').html(),
        preview: $('#preview').find('.active').find('.title span').html(),
        contain: $('#edit-panel').html(),
        time: getTime()
    }

    if(!params.preview || params.preview === '') return;

    axios.get('/saveEdit', {
        params: params
    })
    .then(function(response){

    })
    .catch(function(error){

    })
}